<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "app",
  data(){
    return {
      curIndex: 0
    }
  },
  watch: {
    $route(to, from) {
      // console.log(to.path);
      // if(to.path.indexOf('home')!=-1){
      //   this.$store.dispatch('changeUrlIndex', 0);
      // }else if(to.path.indexOf('invest')!=-1){
      //   this.$store.dispatch('changeUrlIndex', 1);
      // }else if(to.path.indexOf('find')!=-1){
      //   this.$store.dispatch('changeUrlIndex', 2);
      // }else if(to.path.indexOf('mine')!=-1){
      //   this.$store.dispatch('changeUrlIndex', 3);
      // }
    }
  },
  mounted(){
    this.curIndex = this.$store.state.navInfo.urlIndex;
    // console.log(this.$store.dispatch('changeUrlIndex', 1));
  }
};
</script>

<style lang="less">
@import "~vux/src/styles/reset.less";
@import "./assets/css/index.less";
body {
  background-color: #fbf9fe;
}
</style>
